package com.onec.service.manage.service.user.impl;


import com.onec.service.api.dto.response.BaseResponse;
import com.onec.service.manage.dao.UserMenuMapper;
import com.onec.service.manage.dto.user.UserMenuInfo;
import com.onec.service.manage.dto.user.UserMenuResp;
import com.onec.service.manage.service.user.UserMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 增加service 菜单缓存支撑！
 *
 * @author ONEC
 */
@Cacheable(value = "UserMenuService", cacheManager = "cacheManager")
@Service
public class UserMenuServiceImpl implements UserMenuService {

    @Autowired
    UserMenuMapper userMenuMapper;


    @Override
    public BaseResponse selectUserMenuInfo(Long userId) {
        List<UserMenuInfo> userMenuInfos = userMenuMapper.selectUserMenuByUserId(userId);
        return UserMenuResp.respOk(userMenuInfos);
    }
}
